<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>远程专家后端平台 - 登录</title>

    <link href="hplus/css/bootstrap.min.css" rel="stylesheet">
    <link href="hplus/css/font-awesome.css" rel="stylesheet">

    <link href="hplus/css/animate.css" rel="stylesheet">
    <link href="hplus/css/style.css" rel="stylesheet">
    <script src="../../pages/bootstrap/sweetalert/sweetalert.min.js"></script>  
	<link rel="stylesheet" href="../../pages/bootstrap/sweetalert/sweetalert.css">
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    <script>if(window.top !== window.self){ window.top.location = window.location;}</script>
</head>

<body class="gray-bg">

    <div class="middle-box text-center loginscreen  animated fadeInDown">
        <div>
            <div>

                <h1 class="logo-name">TE</h1>

            </div>
            <h3>远程专家后端平台</h3>

            <form class="m-t" role="form">
                <div class="form-group">
                    <input id="username" type="text" class="form-control" placeholder="用户名">
                </div>
                <div class="form-group">
                    <input id="password" type="password" class="form-control" placeholder="密码">
                </div>
				<div class="text-center">
                    <a onclick="login()" class="btn btn-primary block full-width m-b" href="#">登陆</a>
                </div>
				 
                <p class="text-muted text-center"> <a href="#"><small>忘记密码了？</small></a> | <a href="#">注册一个新账号</a>
                </p>
                
                <div>
                	<font color="red" id="errorInfo"></font>
                </div>

            </form>
        </div>
    </div>

    <!-- 全局js -->
    <script src="hplus/js/jquery.min.js"></script>
    <script src="hplus/js/bootstrap.min.js"></script>

</body>
<script type="text/javascript">

function login(){
	//window.location.href = "home.jsp";

	$.ajax({
        type: "post",
        dataType: "json",
        url: '../login/login',
        data:{
        	username:$("#username").val(),
        	password:$("#password").val()
        },
        success: function (data) {
        	if(data.status=="0"){
        		//document.getElementById("errorInfo").innerHTML = data.msg;
        		swal("账号或密码错误，请重新输入", "", "error");
        	}else{
        		window.location.href = "home.jsp";
        	}
        },
		error:function(){
		}
    });
	
}

</script>
</html>
